#!/bin/bash
trap 'echo Abort ; exit 1' ERR
err() { echo "Error. $@ not set."; exit 1; }
. varlist
[ -z "$ARM_ROOT_DIR" ] && err ARM_ROOT_DIR
[ -z "$TARGET" ] && err TARGET

echo Make links.
[ -f $ARM_ROOT_DIR/.link ] && exit 0

cd $ARM_ROOT_DIR/usr/bin
for F in `ls ${TARGET}-*`; do
	ln -s $F arm-linux${F##${TARGET}} 
	ln -s $F ${F##${TARGET}-}
done

ln -s ${TARGET}-gcc ${TARGET}-cc
ln -s ${TARGET}-gcc cc

touch $ARM_ROOT_DIR/.link
